<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增系统活动配置')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-sysActConfig-edit">
        <input type="hidden" name="id" class="form-control"  th:value="${actConfig.id}" >
        <div class="form-group">
            <label class="col-sm-3 control-label">活动名称：</label>
            <div class="col-sm-8">
                <input name="actName" class="form-control"  th:value="${actConfig.actName}" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">活动类型：</label>
            <div class="col-sm-8">
                <select name="type" class="form-control m-b" th:value="${actConfig.type}">
                    <option value="">所有</option>
                    <option th:selected="${actConfig.type == 1}" value="1">营销奖励(反8、4元)</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">活动开始时间：</label>
            <div class="col-sm-8">
                <input name="startDate" th:value="${actConfig.startDate}" class="form-control" readonly type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">活动结束时间：</label>
            <div class="col-sm-8">
                <input name="endDate" th:value="${actConfig.endDate}" class="form-control" readonly type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <input name="note" th:value="${actConfig.note}" class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "sysActConfig/sysActConfig"
    $("#form-sysActConfig-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-sysActConfig-edit').serialize());
        }
    }

    $("input[name='startDate']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='endDate']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>